package com.uenpay.im.ui.old.activity.nearby;

import com.uenpay.im.configuration.APIConfiguration;
import com.uenpay.im.entities.HttpInvokeResult;
import com.uenpay.im.entities.QYXUserEntity;
import com.uenpay.im.invokeitems.BaseHttpInvokeItem;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;

public class ClearLocationInvokeItem extends BaseHttpInvokeItem {
	public class ClearLocationInvokeItemResult extends HttpInvokeResult {
		public int status;
		public String msg;
		public ArrayList<QYXUserEntity> arrayList = new ArrayList<QYXUserEntity>();
	}

	public ClearLocationInvokeItemResult getOutput() {
		return (ClearLocationInvokeItemResult) GetResultObject();
	}
	public ClearLocationInvokeItem() {
		String url = APIConfiguration.getBaseUrl() + "Nearby/Nearby/clearLocation?"
				+ APIConfiguration.getCustIdAndToken();
		SetUrl(url);
	}

	@Override
	protected Object DeserializeResult(String responseBody) {
		ClearLocationInvokeItemResult result = new ClearLocationInvokeItemResult();
		JSONObject json = null;
		try {
			json = new JSONObject(responseBody);
		} catch (JSONException e) {
			e.printStackTrace();
		}
		if (json == null) {
			return null;
		}
		result.status = json.optInt("status");
		result.msg = json.optString("msg");
		return result;
	}
}
